#ifndef WIDGET_H
#define WIDGET_H

#include "map.h"
#include"heroplane.h"
#include<config.h>
#include <QPaintEvent>
#include <QWidget>
#include <QTimer>
#include"bullet.h"
#include"enemyplane.h"
#include"bomb.h"
#include"enemy4.h"
#include"bomb4.h"


class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
    /* 初始化场景 */
    void initScene();

    /* 启动游戏 */
    void playGame();

    /* 更新游戏中元素坐标 */
    void updatePosition();

    /* 绘制 */
    void paintEvent(QPaintEvent *);

    //重写鼠标事件
    void mouseMoveEvent(QMouseEvent*);
    //
    void enemytoscene();
    void enemytoscene4();
    //碰撞检测
    void collisionDetection();
     void collisionDetection4();
     void collisionDetectionm();
     void isstop();

    //地图对象
   map m_map;

   //飞机对象
heroplane m_hero;
//heroplane m_enemy1;//中间的敌机
//敌机对象1
enemy4 m_Enemy4;
enemy4 m_enemy1;//中间敌机
enemyplane m_Enemy;
    //定时器
    QTimer m_Timer;
    //敌机出场间隔
    int m_recorder;
    int m_recorder4;
    //敌机数组
    enemyplane m_enemy[ENEMY_NUM];
    enemy4 m_enemy4[ENEMY_NUM4];

    //爆炸数组
    bomb m_bomb[BOMB_NUM];
    bomb4 m_bomb4[BOMB_NUM4];


//子弹对象  Bullet temp_Bullet;
};
#endif // WIDGET_H
